{include file=$header_start}
{strip}
<link rel="stylesheet" type="text/css" href="{$siteroot}/templates/default/style/dashboard.css">
<link rel="stylesheet" type="text/css" href="{$siteroot}/templates/default/style/registration.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="{$siteroot}/includes/js/admin/ajax.js" type="text/javascript" ></script>

{/strip}
{literal}
<script>
	jQuery(document).ready(function(){
		$( "#btn_back" ).click(function(){
			window.location.href=SITEROOT + '/myaccount/servicesconfirm/';
		});	
		
		$("#btn_remove").click(function(){
			var flag = false;
			$(".listservices").each(function(ind,el){
				if($(el).is(':checked'))
					flag = true;
			});	
			if(flag)
			{
				$("#ServicesList").attr('action',SITEROOT + '/myaccount/servicesconfirm/');
				$("#ServicesList").submit();
			}
			else
			{
				alert("Please select at least of one trade category");
				return false;	
			}
			
		});	
		
		$("#btn_next").click(function(){
			
			if($("#method_nab").is(":checked"))
			{
				var flag = true;
				//valid cardtype
				if($('#cardtype').val()=="")
				{
					flag = false;
					$("#cardtype_msg").html("Please select card type");	
				}
				else
					$("#cardtype_msg").html("");	
					
				// check card number
				if($('#cardnumber').val().length <12)
				{
					flag = false;
					$("#cardnumber_msg").html("Please enter correct card number");	
				} 
				else	
					$("#cardnumber_msg").html("");	
				if($("#cardcode").val().length!=3)
				{
					flag = false;
					$("#cardcode_msg").html("Please enter correct ccv number");
				}
				else
					$("#cardcode_msg").html();
				if(flag)
					return;
				else
				{
					alert("Please check your card info");
					return false;	
				}	
						
			}
			if($("#method_paypal").is(":checked"))
			{
				return true;	
			}			
		})
			
	});
</script>

{/literal}

{include file=$header_end}

<body></body>
   <!-- MIDDLE CONTAIN GOES HERE -->
<section class="middle_portion">
	<section class="inner_head">Dashboard</section>
    <section class="inner_containstart">
    	<!-- dashboard Left Content Start -->
        	{include file=$cms_left_content}
        <!-- dashboard Left Content End -->
        <!-- dashboard Right Content Start -->
        	<section class="dash_right">            	                
            {if $msg}<span style="padding:10px">{$msg}</span>{/if}
            	<section class="title_box">
                   <span class="lF"> <h4>My Service & location</h4></span> <!--<span class="rF" style="padding-top:10px;" >"Want to add more Trade Category? Update your Trade Category and Job Type – <a href="{$siteroot}/myaccount/mytradecategory/">click here</a>" </span>-->
         
                    <section class="clear"></section>
                </section>
                
                
                <form method="post" action="{$siteroot}/myaccount/gotopayment/" name="ServicesList" id="ServicesList" class="regist_form">
                
                <p>
                	<h3 style="font-size:16px;">Your Trades</h3>               
                </p>
                
                  	<div class="usercats" style="margin:20px 0 50px;">
                    	<div id="accordion">
                        
                            <table cellpadding="0" cellspacing="0" width="100%" class="table_viewbox">
                                <thead>
                                    <tr>
                                        <th>Trade Name</th>
                                        <th width="200" style="text-align:center;">Job Type</th>
                                        <th width="100" style="text-align:center;">Expiry time</th>
                                        <th width="80" style="text-align:right;">Price</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    
                                    {section name=i loop=$subcats}
                                    <tr>
                                        <td>{$subcats[i].trade_category}</td>
                                        <td>{$subcats[i].jobtype}</td>                                        
                                        <td style="text-align:center;">{$subcats[i].expired_time} months</td>
                                        <td style="text-align:right;">${$subcats[i].price}</td>
                                     </tr>
                                    {/section}
                                   <tr>
                                        <td colspan="3" style="text-align:right;"><strong>Total</strong></td>
                                        <td style="text-align:right;">${$subtotal}</td>
                                     </tr>
                                   <tr>
                                        <td colspan="3" style="text-align:right;"><strong>Tax (GST)</strong></td>
                                        <td style="text-align:right;">${$tax}</td>
                                     </tr>
                                   <tr>
                                        <td colspan="3" style="text-align:right;"><strong>Total</strong></td>
                                        <td style="text-align:right;">${$total}</td>
                                     </tr>
                                </tbody>
                            </table>        	
                            
                        </div>
                        
                         <p>
                            <h3 style="font-size:16px;">Select a payment method </h3>               
                        </p>
                        
                        <div class="payment" style="margin-top:20px;">
                       
                         {if $paypal.published eq 1}
                            <div class="paypal" style="margin-bottom:50px;">
                                <input type="radio" name="paymentmethod" value="paypal"  checked="checked" id="method_paypal" /> <strong>Paypal</strong>
                                <hr />
                                <p align="right">
                                <img src="../../images/paypal.jpg">
                                </p>
                                
                            </div>
                            
                        {/if}
                        
                        <section class="clear"></section>
                        {if $nab.published eq 1}
                            <div class="nab">
                                <input type="radio" name="paymentmethod" value="nab"  id="method_nab" /> <strong>NAB</strong><br />
                                <hr />
                                <div class="nablogo" style="margin-top:10px;">
                                <p align="right">
                                    <img src="../../images/visa_mastercard_logo.gif" height="65" />
                                    <img src="../../images/nab.jpg"  height="65"/>
                                </p>
                                </div>
                                
                                
                                <dl>
                                <dt>Card Type</dt>
                                <dd>
                                    <select class="input3" id="cardtype" name="cardtype">
                                        <option value="">Select Card Type</option>
                                        <option value="Visa" {if $detail.cardtype eq 'Visa'} selected="selected" {/if}>VISA </option>
                                        <option value="MasterCard" {if $detail.cardtype eq 'MasterCard'} selected="selected" {/if}>Master Card </option>
                                        <option value="AmEx" {if $detail.cardtype eq 'AmEx'} selected="selected" {/if}>American Express </option>
                                        
                                    </select>
                                </dd>
                                <section class="clear"></section>
                                <div style="color:#F00;" id="cardtype_msg"></div>
                            </dl>
                              
                              
                                
                        <dl>
                            <dt>Card Number</dt>
                            <dd><input type="text" class="input" name="cardnumber" id="cardnumber" maxlength="16" value="{$detail.cardnumber}" /></dd>
                            <section class="clear"></section>
                            <div style="color:#F00;" id="cardnumber_msg"></div>
                        </dl>
                 		<div style="width:470px">
                            <dl class="space10">
                                <dt>Security Code</dt>
                                <dd><input type="text" class="input10" name="cardcode" id="cardcode"  maxlength="4"  value="{$detail.cardcode}" /></dd>            
                                <section class="clear"></section>
                                
                                <div style="color:#F00;" id="scode_msg"></div>
                            </dl>
                            <dl class="space40">
                                <dt>Expiration Date</dt>
                                <dd>
                                 <section class="select_box_container">
                                    <select class="select Rmargin15" name="cardmonth" id="cardmonth">
                                        <option value="">Select Month</option>
                                        {section name=k start=1 loop=13 step=1}
                                            <option value="{$smarty.section.k.index|str_pad:2:"0":$smarty.const.STR_PAD_LEFT}" {if $detail.cardmonth == $smarty.section.k.index|str_pad:2:"0":$smarty.const.STR_PAD_LEFT} selected="selected" {/if}>{$smarty.section.k.index|str_pad:2:"0":$smarty.const.STR_PAD_LEFT}</option>
                                        {/section}
                                    </select>
                                </section>
                                 <section class="select_box_container">    
                                    <select class="select Rmargin15" name="carddate" id="carddate">
                                        <option value="">Select Year</option>
                                        {section name=yr loop=$yr_arr}
                                            <option value="{$yr_arr[yr]}" {if $detail.carddate == $yr_arr[yr]} selected="selected" {/if}>{$yr_arr[yr]}</option>
                                        {/section}
                                    </select>
                                 </section>   
                                </dd>
                                <div id="date_error" style="color:#F00;"></div> 
                                <section class="clear"></section>
                            </dl>
                    	</div>
                        <dl>
                            <dt>Cardholder Name</dt>
                            <dd><input type="text" class="input" name="card_holder" id="card_holder" value="{$detail.card_holder}" maxlength="20" /></dd>
                            <section class="clear"></section>
                        </dl>
                   
                            </div>
                         {/if}
                         </div>
                         <section class="clear"></section>
                        <hr/>
                        <table cellpadding="0" cellspacing="0" width="100%" border="0">
                            <tr>
                               <td align="left" width="50%"></td>
                                <td align="right"><input type="button" class="blue_btn rF" value="Back"  name="back" id="btn_back" /></td>
                                <td align="right" width="70"><input type="submit" class="blue_btn rF" value="Next"  name="btnstep3" id="btn_next" /></td>
                            </tr>
                      </table>
                    </div>
                  
                </section>
                </form> 
            </section>
        <!-- dashboard Right Content End -->
        	<section class="clear"></section>
    </section>
</section>
{include file=$footer}
